<template>
	<view class="container" >
		<view class="nav-bar" :style="{height:customBar+'px',paddingTop:statusBar+'px'}">
			<view class="nav-bar__back" @tap.stop="goBack">
				<text class="esfont" style="color:#fff;font-size: 28rpx;">&#xe6b2;</text>
			</view>
		</view>
		<video id="myVideo" class="video"  :src="url" :autoplay="true" :loop="true"
			object-fit="contain" :controls="false" :enable-play-gesture="true"></video>
	</view>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				url: "",
				customBar: 0,
				statusBar: 0
			}
		},
		created(){
			uni.getSystemInfo({
				success: e => {
					this.customBar = e.statusBarHeight + (e.platform == 'android'?50:45);
					this.statusBar = e.statusBarHeight;
				}
			});
		},
		onLoad: function(options) {
			let url = options.url;
			if (!url) {
				uni.showToast({
					icon: "none",
					title: '无视频源',
				})
				uni.navigateBack();
			} else {
				this.url = url
			}
		},
		methods:{
			goBack(){
				uni.navigateBack();
			}
		}
	}
</script>

<style>
	.container {
		width: 750rpx;
		height: 100vh;
		background-color: black;
	}

	.nav-bar {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 99;
	}

	.nav-bar__back {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		width: 70rpx;
		height: 70rpx;
		border-radius: 70rpx;
		margin: 0 20rpx;
		background-color:rgba(112, 112, 112, 0.5) ;
	}

	.video {
		width: 750rpx;
		height: 100vh;
	}
</style>
